home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / image.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  47 lines

  1. /*  IMAGE.H    This file contains the simple toolkit for working with images.
  2.     Images are in the getimage() formate. We use the postulate, that
  3.     color pictures have 4 planes, and BW pictures - one.
  4. */
  5.  
  6. #ifndef __IMAGE_H_
  7. #define __IMAGE_H_
  8.  
  9. #include <alloc.h>
  10. #include "graphpp.h"
  11. #include "image_p.h"
  12.  
  13. enum { BW, COLOR };
  14.  
  15. /*
  16.     Read pixel color from image.
  17. */
  18. extern int image_get_pixel(imageP image, loc pos, int bitpx = 1,
  19.                            int nplanes = 4);
  20. /////////////////////////
  21. /*
  22.     Put pixel to the image, changing all planes, if necessary.
  23. */
  24. extern void image_put_pixel(imageP image, loc pos, int col,
  25.                 int bitpx = 1, int nplanes = 4);
  26. /////////////////////////
  27. /*
  28.     Shows part of image on screen with deformation.
  29.     Arguments: src - rectangle in source image, dest - left-top coordinates
  30.                on screen, ... , comp_s and comp_d - deformation of source
  31.                and destination, it corresponds to divx, divy, multx, multy,
  32.            flag == 1 - use image_get_pixel - for pixel - to - pixel
  33.            (not byte - to byte) output, trans contains directive to
  34.            use one of the colors as transparent (do not show it).
  35.                Default value is 16 (no transparent color).
  36. */
  37. extern void image_screen(imageP image, rect src, loc dest,   // src - in image, dest - on screen
  38.          int bitpx = 1, int nplanes = 4,
  39.          loc comp_s = loc(1, 1),
  40.          loc comp_d = loc(1, 1), int flag = 0);
  41.  
  42. /*
  43.     Copies part of screen to the part of image, no deformation.
  44. */
  45. extern void screen_image(imageP image, rect scr, loc dest); // no deformation
  46.  
  47. #endif __IMAGE_H_